<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>选择图像</title>
</head>
<body>
<img width="200" height="150" src="" alt="my image">
<script>
    var myImages = [
        'usa.gif',
        'canada.gif',
        'jamaica.gif',
        'mexico.gif'
    ];

    var imgIndex = prompt('Enter a number from 0 to 3', '');
    document.images[0].src = myImages[imgIndex];
</script>
</body>
</html>